<%@ page contentType="text/html; charset=UTF-8"  import="com.lilili.ssh.login.model.*"%>
<%@ page import="com.lilili.ssh.relation.model.*" %>
<%@ page import="com.lilili.ssh.user.model.*" %>
<%@ page import="java.util.List;"%>
<%@ include file="/safe.jsp" %>
<%
SysInfo sysInfo=new SysInfo();
User user=(User)session.getAttribute("loginUser");
if(session.getAttribute("sysInfo")!=null){
	sysInfo=(SysInfo)session.getAttribute("sysInfo");
}
%>
<html>
<head>
<title>书籍管理模拟系统</title>
<style type="text/css">
<!--
body,td,th {
	font-family: 宋体;
	font-size: 12px;
}
.b{


  width:700px; height:700px;  margin-left:200px; margin-top:100px;

}
-->
</style>
<script type="text/javascript" src="main.js">
</script>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#6A95B8">
<div class="b">
<table id="mainTable" border="0" cellpadding="0" cellspacing="0" width="750" align="center">
  <tr>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="27" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="23" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="32" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="156" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="8" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="12" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="6" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="41" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="388" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="57" height="1" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
   <td colspan="10"><img name="img_r1_c1" src="<%=request.getContextPath()%>/img/r1c1.jpg" width="750" height="14" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="14" border="0"></td>
  </tr>
  <tr>
   <td rowspan="11"><img name="r2c1" src="<%=request.getContextPath()%>/img/r2c1.jpg" width="27" height="426" border="0"></td>
    <td><a href="#" onMouseOut="FWstartTimeout();" ><img name="r2c2" src="<%=request.getContextPath()%>/img/r2c2.jpg" width="23" height="15" border="0" onClick="window.FWshowMenu(window.fwmenu0,127,24)"></a></td>
   <td colspan="8" rowspan="2" background="<%=request.getContextPath()%>/img/r2c3.jpg">&nbsp;</td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="15" border="0"></td>
  </tr>
  <tr>
   <td><img name="r3c2" src="<%=request.getContextPath()%>/img/r3c2.jpg" width="23" height="8" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="8" border="0"></td>
  </tr>
  <tr>
   <td colspan="5"><img name="r4c2" src="<%=request.getContextPath()%>/img/r4c2.jpg" width="231" height="53" border="0"></td>
   <td rowspan="3" colspan="2"><img name="r4c7" src="<%=request.getContextPath()%>/img/r4c7.jpg" width="47" height="105" border="0"></td>
   <td id="aimTd" rowspan="8" bgcolor="#FFFFFF" valign="top">
   <table border=1 cellspacing=0 width=380px align=center>
   <tbody>
   <tr>
   <td colspan="3"  bgcolor='#6A95B8'>借阅信息</td>
   </tr>
   <tr>
   <td width="30">序号</td><td>书名</td><td>读者</td>
   </tr>
   <%
   List<Relation> relationList=sysInfo.getRelationList();
   if(relationList!=null){
	   int i=0;
	   for(Relation o:relationList){
		   i++;
	   %>
	   <tr>
	   <td><%=i %></td>
	   <td><%=o.getBookname()%></td>
	   <td><%=o.getUsername()%></td>
	   </tr>
	   <%
	   }
   }
   %>
   </tbody>
   </table>
   </td>
   <td rowspan="9"><img name="r4c10" src="<%=request.getContextPath()%>/img/r4c10.jpg" width="57" height="403" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="53" border="0"></td>
  </tr>
  <tr>
   <td colspan="5"><img name="r5c2" src="<%=request.getContextPath()%>/img/r5c2.jpg" width="231" height="42" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="42" border="0"></td>
  </tr>
  <tr>
   <td rowspan="7" colspan="2"><img name="r6c2" src="<%=request.getContextPath()%>/img/r6c2.jpg" width="55" height="308" border="0"></td>
    <td rowspan="5" bgcolor="#FFFFFF" valign="top">
    <table>
    <tr>
    <td style="color: red;">管理员信息：</td>
    </tr>
    <tr>
    <td>姓名:${loginUser.name}</td>
    </tr>
    <tr>
    <td>登录名:${loginUser.loginName}</td>
    </tr>
    <tr>
    <td>注册日期:${loginUser.regDate}</td>
    </tr>
    <%
    if(user.getStatu()==0){
    %>
    <tr>
    <td style="color: red;">系统信息：</td>
    </tr>
    <tr>
    <td>可用用户:${sysInfo.availableUsers} 人</td>
    </tr>
    <tr>
    <td>过期用户:${sysInfo.notAvailableUsers}  人</td>
    </tr>
    <tr>
    <td>在库书籍:${sysInfo.booksInStore}  册</td>
    </tr>
    <tr>
    <td>借出书籍:${sysInfo.booksByUser}  册</td>
    </tr>
    <tr>
    <td>废弃书籍:${sysInfo.abandonBooks}  册</td>
    </tr>
    <tr>
    <td><input type="button" name="userBtn" value="用户管理" onclick="viewUser();"/></td>
    </tr>
    <tr>
    <td><input type="button" name=bookBtn value="书籍管理" onclick="viewBook();"/></td>
    </tr>
    <%}else if(user.getStatu()==1){%>
    <tr>
    <td>用户类型:普通用户</td>
    </tr>
    <%}else if(user.getStatu()==-1){%>
    <tr>
    <td>用户类型:过期用户</td>
    </tr>
    <%} %>
    <tr>
    <td><input type="button" name=exitBtn value="退出系统" onclick="exit();"/></td>
    </tr>
    </table>
    </td>
   <td colspan="2"><img name="r6c5" src="<%=request.getContextPath()%>/img/r6c5.jpg" width="20" height="10" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="10" border="0"></td>
  </tr>
  <tr>
   <td rowspan="6"><img name="r7c5" src="<%=request.getContextPath()%>/img/r7c5.jpg" width="8" height="298" border="0"></td>
   <td colspan="2"><img name="r7c6" src="<%=request.getContextPath()%>/img/r7c6.jpg" width="18" height="16" border="0"></td>
   <td rowspan="6"><img name="r7c8" src="<%=request.getContextPath()%>/img/r7c8.jpg" width="41" height="298" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="16" border="0"></td>
  </tr>
  <tr>
   <td colspan="2"><img name="r8c6" src="<%=request.getContextPath()%>/img/r8c6.jpg" width="18" height="14" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="14" border="0"></td>
  </tr>
  <tr>
   <td colspan="2"><img name="r9c6" src="<%=request.getContextPath()%>/img/r9c6.jpg" width="18" height="14" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="14" border="0"></td>
  </tr>
  <tr>
   <td rowspan="3" colspan="2"><img name="r10c6" src="<%=request.getContextPath()%>/img/r10c6.jpg" width="18" height="254" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="203" border="0"></td>
  </tr>
  <tr>
   <td rowspan="2"><img name="r11c4" src="<%=request.getContextPath()%>/img/r11c4.jpg" width="156" height="51" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="12" border="0"></td>
  </tr>
  <tr>
   <td><img name="r12c9" src="<%=request.getContextPath()%>/img/r12c9.jpg" width="388" height="39" border="0"></td>
   <td><img src="<%=request.getContextPath()%>/img/spacer.gif" width="1" height="39" border="0"></td>
  </tr>
</table>
<script type="text/javascript">
   function getData(obj)
    { 
      var url=requestContextPath+'/info/login_view'+obj+'.do';
      url=encodeURI(url);
      createXmlHttp();
      xmlHttp.open("POST",url,false);
      xmlHttp.send(null);
      if(xmlHttp.status==200) 
         {  
           var aimTd=document.getElementById("aimTd");
           aimTd.innerHTML=xmlHttp.ResponseText;
         }
    }
   //创建XMLHttpRequest 对象
   function  createXmlHttp() 
    { 
        if(window.ActiveXObject) 
        { 
            //IE旧版本 
            try 
            { 
                xmlHttp=new ActiveXObject("Msxm12.XMLHttp"); 
            } 
            catch(e) 
            {} 
            //IE新版本 
            try 
            { 
                xmlHttp=new ActiveXObject("Microsoft.XMLHttp"); 
            } 
            catch(e) 
            {} 
            //如果没有创建成功，抛出提示信息 
            if(!xmlHttp) 
            { 
                Ext.MessageBox.alert("警告","不能创建XMLHttpRequest对象实例！"); 
                return false; 
            }        
      } 
    }
</script>
</div>
</body>
</html>
